package com.xiaoyy.core.common.enums;
/**
 * 用户类型
 * @author chenzh
 * @date 2018-08-12
 * */
public enum UserTypeEnum {
    SUP_ADMIN("00","超级系统管理员"),
    ADMIN("10","普通管理员"),
    USER("20","个人用户"),
    COMPANY("30","企业用户"),
    CLIENT("40","第三方应用接入用户"),
    OTHER_SYSTEM("90","其他系统用户（接口调用）");
    private String type;
    private String name;

    UserTypeEnum(String type, String name) {
        this.type = type;
        this.name = name;
    }

    public String getType() {
        return this.type;
    }

    public String getName() {
        return this.name;
    }

    public static UserTypeEnum getByType(String type) {

        for (UserTypeEnum typeEnum : values()) {
            if (typeEnum.getType().equalsIgnoreCase(type) ) {
                return typeEnum;
            }
        }
        return null;
    }
}
